package com.goodedeeds.webapp.controller;

import com.youtills.core.lang.StringUtil;
import net.sourceforge.stripes.action.UrlBinding;

/**
 * Created by IntelliJ IDEA.
 * User: ravi
 * Date: 8/12/12
 * Time: 10:58 PM
 * To change this template use File | Settings | File Templates.
 */
@UrlBinding(VerifyEmailAction.URL)
public class VerifyEmailAction extends QuiggleAction {
    public static final String URL = "/verify-email.action";

    private static final String QUIGGLE_CONTENT = JSP_ROOT + "/verify-email.jsp";

    private String email;
    private String unlockCode;
    /* (non-Javadoc)
      * @see com.depo.quiggle.view.controller.BaseDashboardAction#getDashboardContent()
      */

    @Override
    public String getQuiggleContent() {
        return QUIGGLE_CONTENT;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getUnlockCode() {
        return unlockCode;
    }

    public void setUnlockCode(String unlockCode) {
        this.unlockCode = unlockCode;
    }


    private Boolean unlocked;
    public boolean isUnlocked(){
        if(unlocked == null){
            if(!StringUtil.isEmpty(email) && !StringUtil.isEmpty(unlockCode)){
//                unlocked = AdministrationDaoFactory.getAdministrationDao().unlockUser(email, unlockCode);
            }else{
                unlocked = false;
            }
        }

        return unlocked;
    }
}
